function [negloglik, derivs] = eq_3_44(hyps, func, n, n_class, X, y, approxF)
% a function evaluating equation 3.44 and derivatives, of R&W
% by Mark Norrish, 2011
% note: actually uses a bunch of other equations, esp. for derivations

% hyps should either have the same dimension as func requires,
% or n_class times that amount

% approxF is an initial guess to fHat and is an optional argument only;
% it speeds things up if it is provided

if length(hyps) ~= str2num(func()) * n_class
  hypsn = repmat(hyps, n_class, 1);
else
  hypsn = hyps;
end
negloglik = log_det_B(hypsn, func, n, n_class, X, y, approxF);
derivs = del_log_det_B(hypsn, func, n, n_class, X, y, approxF);